#ifndef BTFORM_H
#define BTFORM_H

#include <QWidget>
#include<QPropertyAnimation>
namespace Ui {
class BtForm;
}

class BtForm : public QWidget
{
    Q_OBJECT

public:
    explicit BtForm(QWidget *parent = nullptr);
    ~BtForm();

    void seticon(QString btIcon,QString content,int mid);
    int getId();
    //清理背景颜色
    void clearBackground();
    //设置线条动画
    void setLineAnimation(QWidget* target, int duration, int x, int y, int width, int height);
    //显示动画
    void showAnimation();
    //隐藏动画
    void hideAnimation();
    //设置选中
    void setSelected(int id);
signals:
    void btClick(int id);

protected:
    // 鼠标点击事件
    virtual void mousePressEvent(QMouseEvent *event);
private:
    Ui::BtForm *ui;
    int id = 0;//该按钮对应的page页

    // linebox动画起伏效果
    QPropertyAnimation *animationLine1;
    QPropertyAnimation *animationLine2;
    QPropertyAnimation *animationLine3;
    QPropertyAnimation *animationLine4;

};

#endif // BTFORM_H
